<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
// use Illuminate\Support\Facades\Schema;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateQuestionTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sf_student_question', function (Blueprint $table) {
            $table->comment = '学生问题吐槽表';
            $table->bigIncrements('id');
            $table->tinyInteger('status')->comment('状态：1未读，2已读')->default(1);
            $table->tinyInteger('verify')->comment('审核状态： 0未审核，1审核通过，2审核不通过')->default(0);
            $table->integer('class_id')->comment('班级id')->default(0);
            $table->integer('class_type')->comment('班级类型')->default(1);
            $table->string('class_name', 100)->comment('班级名称')->default('');
            $table->text('content')->comment('问题内容');
            $table->string('teacher_ids', 100)->comment('老师ids')->default('');
            $table->bigInteger('created_time')->comment('创建时间')->default(0);
            $table->bigInteger('update_time')->comment('创建时间')->default(0);

            $table->index('status');
            $table->index('verify');
            $table->index('class_id');
        });
        // DB::statement("ALTER TABLE `sf_student_question` comment '学生问题吐槽表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sf_student_question');
    }
}
